<template>
	<view class="bottom-consult-bar">
		<view class="bottom-consult-bar-main">
			<view class="lawyer-info">
				<view class="lawyer-name">
					廖开喜律师
				</view>
				<view class="slogan">
					专业一站式法律服务平台
				</view>
			</view>
			<view class="consult-list">
				<view class="consult-item" @click="toConsult(1)">
					<view class="item-icon">
						<i class="iconfont icon-quickly_consult icon" />
					</view>
					<view class="item-name">
						快速咨询
					</view>
				</view>
				<view class="consult-item" @click="toConsult(2)">
					<view class="item-icon">
						<i class="iconfont icon-mobile_consult icon" />
					</view>
					<view class="item-name">
						电话咨询
					</view>
				</view>
				<view class="consult-item" @click="toConsult(3)">
					<view class="item-icon">
						<i class="iconfont icon-case_analysis icon" />
					</view>
					<view class="item-name">
						案件分析
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			lawyerDetailData: {
				type: Object,
			}
		},
		methods: {
			toConsult(type) {
				if (type == 1) {
					this.toQuicklyConsult();
				} else if (type == 2) {
					this.$u.route(`/pages/phone_consult/phoneConsult?lawyerId=${this.lawyerDetailData.id}`)
				} else if (type == 3) {
					this.$u.route(`/pages/form_consult/formConsult?lawyerId=${this.lawyerDetailData.id}`)
				}

			},
			toQuicklyConsult() {
				uni.switchTab({
					url: '/pages/consult/consult',
					success: () => {
						this.$u.vuex('currentLawyerId', this.lawyerDetailData.id);
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import "./bottomConsultBar.scss";
</style>
